package com.lisx.module_add_new_word.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.recyclerview.widget.RecyclerView;

import com.lisx.module_add_new_word.R;
import com.lisx.module_add_new_word.bean.WordBean;

import java.util.List;

public class TipsAdapter extends RecyclerView.Adapter<TipsAdapter.VideoHolder> {

    private List<String> mList;
    private Context mcontext;

    private OnItemClickLitener mOnItemClickLitener;


    //定义点击接口
    public interface OnItemClickLitener {
        void onItemClick(int position);
    }

    public void setOnItemClickLitener(OnItemClickLitener mOnItemClickLitener) {
        this.mOnItemClickLitener = mOnItemClickLitener;
    }

    public TipsAdapter(Context mcontext, List<String> mList) {
        this.mcontext = mcontext;
        this.mList = mList;

    }

    @Override
    public VideoHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_tips, parent, false);
        return new VideoHolder(itemView);
    }

    @Override
    public void onBindViewHolder(final VideoHolder holder, final int position) {
        holder.tv_tips.setText(""+mList.get(position));
    }

    @Override
    public int getItemCount() {
        return mList.size();
    }

    public class VideoHolder extends RecyclerView.ViewHolder {
        private TextView tv_tips;
        VideoHolder(View itemView) {
            super(itemView);
            tv_tips = itemView.findViewById(R.id.tvtips);
        }
    }
}